1. Field
The disclosure relates generally to an improved data processing system and more specifically to file system management in a storage device.
2. Description of the Related Art
Data stored in data processing systems are often stored on storage devices. One non-limiting example of a storage device is a hard drive. Prior to storing data on the storage device, an operating system generates a partition on the storage device. The operating system then generates a file system within the partition on the storage device.
The file system allows the operating system to store data on the storage device, locate data on the storage device, and retrieve data on the storage device. For example, the file system may contain a listing of files stored on the storage device and addresses on the storage device for the data that constitute each file. The file system may store data in objects within the file system. Some examples of objects in a file system are folders and files.
Of course, the file system may contain other items used by the operating system to manage the data within the file system. For example, the file system may contain an identifier for the file system, an identifier for the type and version of the file system, and a mapping of locations for the files and folders stored in the file system. The items may be generated in the file system to implement a particular standard. For example, a file system may be an ext3 file system. An ext3 file system stores data in blocks, and each block of data is in a group. The ext3 file system also stores metadata about the file system, as well as each group of blocks.
In some file systems, one or more pointers are associated with a first object in the file system. One pointer associated with the object may contain an identifier for a second object contained within the first object. For example, the first object may be a folder, and the folder is associated with a pointer that contains an identifier for a file contained in the folder. Additionally, another pointer associated with an object in the file system may contain an identifier for a parent object of the object. For example, a file stored in the file system may be associated with a pointer to the folder containing the file.
At times, one or more pointers associated with an object in the file system may become inconsistent. A pointer associated with a first object is inconsistent when the pointer contains an identifier of a second object that is not associated with a pointer that contains the identifier of the first object. In other words, a parent object for a child object may have an inconsistent pointer if a pointer associated with the child object points to the parent object, but the parent object is not associated with a pointer that points to the child object. Likewise, a child object of a parent object may have an inconsistent pointer if a pointer associated with the parent object points to the child object, but the child object is not associated with a pointer that points to the parent object.